<body class="brands_bg">

<div class="wrap_main">

<div class="wrap_outer">
		<?php $this->widget('application.widgets.ProfileMenu', array()); ?> 
    <div class="content_wrap">
        <div class="spacer10">&nbsp;</div>
        <div class="left_content fl">
        	<!--- mycart #s--->
			<div>	
	<div class="title_offer pb15">My <span class="helv_neue_thin">Cart</span></div>
		<div>	
		
		<?php 
			$flag = 'left';
			if(!empty($cartVal)){ 
				foreach($cartVal as $val){
					$offer = Offer::model()->getModel('MY-CART-OFFER',array('offerID'=>$val->offerID));
					if(!empty($offer)){
						foreach($offer as $key=>$value){
							if($flag = 'left'){
		?>
		
			<div class="offer_list pb15 fl">
				<div class="y_ball fl"><img src="<?php echo ApplicationConfig::getImageUrl('OFFER-THUMBNAIL', array('file_name'=>$value->offer_image_thumb)); ?>" height="60" width="60"></div>
				<div class="fl ml10 offer_info">
					<div class="fl lh20">
						<span class="helv_black fnt33"><?php echo $value->offer_value_percentage; ?>%</span>
						<div class="cl"></div>
						<span class="helv_light fnt11">VOUCHER</span>
						<!-- <div style="line-height:12px;" class="helv_light"><a class="gr" href="#"><?php //echo $value->offer_detail; ?></a></div> -->
						<div style="line-height:12px;" class="helv_light"><a class="gr" href="#">Details</a></div>
					</div>
					<div class="fr lh20">
						<div class="title_offer" style="color:#ffcb00;">YC</div>
						<div class="ml5"><a class="gr" href="#">CASH</a></div>
						<div class="title_offer fl" style=" font-size:20px;">150</div>
						<!-- <div class="fl mt3 ml3"><input type="checkbox" name="chk" /></div> -->
						
						<?php
							if (ApplicationSessions::run()->read('userID')!=""){
								echo "<div id='applycartofferdiv$val->offerID'>";
									echo CHtml::activeCheckBox($modelOffer,'offerID',array('ajax'=>array(
										'url'=>ApplicationConfig::getURL("","my","addCart",array('offerTitle'=>$value->offer_title,'offerRedeemPoint'=>$value->offer_redeem_point,'offerID'=>$val->offerID,'userID'=>ApplicationSessions::run()->read('userID'),'vendorID'=>$val->vendorID)),
										'type'=>'POST',
										'success'=>'function(html){
											$("#update_ajax_cart").append(html);
											
										}',
									),'id'=>'applyCart'.$val->offerID)); 
								echo "</div>";
							}
							else 
							{
								echo "<input type='checkbox' name='chk' onclick='checkLogin()'>";
							}
									
						?>	

						<div class="cl"></div>	
					</div>	
					<div class="cl"></div>				
				</div>
		   </div>
		   
		   <?php $flag = 'right'; } else { ?>
		   
		   <div class="offer_list pb15 fr">
				<div class="g_ball fl"><img src="<?php echo ApplicationConfig::getImageUrl('OFFER-THUMBNAIL', array('file_name'=>$value->offer_image_thumb)); ?>" height="60" width="60"></div>
				<div class="fl ml10 offer_info">
					<div class="fl lh20">
						<span class="helv_black fnt33"><?php echo $value->offer_value_percentage; ?>%</span>
						<div class="cl"></div>
						<span class="helv_light fnt11">VOUCHER</span>
						<!-- <div style="line-height:12px;" class="helv_light"><a class="gr" href="#"><?php //echo $value->offer_detail; ?></a></div> -->
						<div style="line-height:12px;" class="helv_light"><a class="gr" href="#">Details</a></div>
					</div>
					<div class="fr lh20">
						<div class="title_offer" style="color:#ffcb00;">YC</div>
						<div class="ml5"><a class="gr" href="#">CASH</a></div>
						<div class="title_offer fl" style=" font-size:20px;">150</div>
						<div class="fl mt3 ml3"><input type="checkbox" name="chk" /></div>
						<div class="cl"></div>	
					</div>	
					<div class="cl"></div>				
				</div>
		   </div>
		   <div class="cl"></div>
		   
		   <?php $flag = 'left'; } ?>
		   
		<?php } } } } else { echo "No values found."; }?>
		<div class="mt5">see more</div>
		<div class="cl"></div>
		</div>
	</div>
			<!--- mycart #e--->
			<div class="spacer20">&nbsp;</div>
			<?php $this->renderPartial('cart_rec',array('offers'=>$offers)); ?>  
			<?php $this->renderPartial('cart_other',array('otherOffer'=>$otherOffer)); ?>  
            <?php include 'frnds_act.php'; ?>  
        </div>
        
        <div class="right_content fr wh">
 			
            <?php $this->renderPartial('yc_cash',array()); ?>
			<div class="spacer10">&nbsp;</div>
            <?php include 'offer_short_tabs.php'; ?>
			<div class="spacer10">&nbsp;</div>
			<?php include 'invitefrnds.php'; ?>
			<div class="spacer10">&nbsp;</div>
			<?php include 'shared_offer.php'; ?>
			<div class="spacer10">&nbsp;</div>
            <?php include 'search_offers.php'; ?>
		
        </div>
        
        <div class="cl"></div>
    </div>
</div>
</div>

<script>

function checkLogin()
{
	$('#aaa').trigger('click');
	$('#LoginForm_username').val("");
	$('#LoginForm_username').focus();
}

</script>